package com.isoft.demo.service.impl;/*
 *@ClassName: CheckServiceImpl
 *@Date: 2021/7/12
 *@Author:刘逸飞
 */

import com.isoft.demo.common.ResponseData;
import com.isoft.demo.dao.CheckDao;
import com.isoft.demo.entity.Checkfee;
import com.isoft.demo.service.CheckService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CheckServiceImpl implements CheckService {

    @Resource
    private CheckDao dao;
    @Override
    public ResponseData integ() {
        return null;
    }

    @Override
    public ResponseData checkAll() {
        List<Checkfee> list = dao.checkAll();
        ResponseData rs = new ResponseData();
        if(list != null){
            rs.setCode(0);
            rs.setMsg("ok");
            rs.setData(list);
        } else {
            rs.setCode(1);
            rs.setMsg("error");
        }
        return rs;
    }

    @Override
    public ResponseData searchProfit() {
        List<Checkfee> list = dao.searchProfit();
        ResponseData rs = new ResponseData();
        if(list != null){
            rs.setCode(0);
            rs.setMsg("ok");
            rs.setData(list);
        } else {
            rs.setCode(1);
            rs.setMsg("error");
        }
        return rs;
    }

    @Override
    public ResponseData searchProfitById(int eid) {
        List<Checkfee> list = dao.searchProfitById(eid);
        ResponseData rs = new ResponseData();
        if(list != null){
            rs.setCode(0);
            rs.setMsg("ok");
            rs.setData(list);
        } else {
            rs.setCode(1);
            rs.setMsg("error");
        }
        return rs;
    }
}
